import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/category',
    method: 'get',
    params: query
  })
}

export function craeteCategory(data) {
  return request({
    url: '/category',
    method: 'post',
    data
  })
}

export function updateCategory(data) {
  return request({
    url: `/category/${data.categoryId}`,
    method: 'put',
    data
  })
}

export function deleteCategory(categoryId) {
  return request({
    url: `/category/${categoryId}`,
    method: 'delete'
  })
}
